Cocktail Help Reference
FindAsync(Func<IQueryable<T>,IQueryable>,Expression<Func<T,Boolean>>,Func<IQueryable,IOrderedQueryable>,Action<IEnumerable>,Action<Exception>) Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > Repository<T> Class > FindAsync Method : FindAsync(Func<IQueryable<T>,IQueryable>,Expression<Func<T,Boolean>>,Func<IQueryable,IOrderedQueryable>,Action<IEnumerable>,Action<Exception>) Method



selector
The selector used to shape the result.
predicate
Optional predicate to filter the returned list of objects.
orderBy
Optional sorting function to sort the returned list of objects.
onSuccess
Optional callback to be called when the entity retrieval was successful.
onFail
Optional callback to be called when the entity retrieval failed.

Glossary Item Box

Retrieves one or more entities matching the provided expression with the repository's default query strategy and projects the results into a different shape using the selector parameter.

Syntax

Visual Basic (Declaration) 
Public Overloads Function FindAsync( _
   ByVal selector As Func(Of IQueryable(Of T),IQueryable), _
   Optional ByVal predicate As Expression(Of Func(Of T,Boolean)), _
   Optional ByVal orderBy As Func(Of IQueryable,IOrderedQueryable), _
   Optional ByVal onSuccess As Action(Of IEnumerable), _
   Optional ByVal onFail As Action(Of Exception) _
) As OperationResult(Of IEnumerable)
Visual Basic (Usage)Copy Code
Dim instance As Repository(Of T)
Dim selector As Func(Of IQueryable(Of T),IQueryable)
Dim predicate As Expression(Of Func(Of T,Boolean))
Dim orderBy As Func(Of IQueryable,IOrderedQueryable)
Dim onSuccess As Action(Of IEnumerable)
Dim onFail As Action(Of Exception)
Dim value As OperationResult(Of IEnumerable)
 
value = instance.FindAsync(selector, predicate, orderBy, onSuccess, onFail)

Parameters

selector
The selector used to shape the result.
predicate
Optional predicate to filter the returned list of objects.
orderBy
Optional sorting function to sort the returned list of objects.
onSuccess
Optional callback to be called when the entity retrieval was successful.
onFail
Optional callback to be called when the entity retrieval failed.

Return Value

Asynchronous operation result.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.